Fxt.hashCode = function(str) {
  var hash = 0, i, chr, len;
  if (str.length === 0) return hash;
  for (i = 0, len = str.length; i < len; i++) {
    chr   = str.charCodeAt(i);
    hash  = ((hash << 5) - hash) + chr;
    hash |= 0; // Convert to 32bit integer
  }
  return hash;
};
var Retcode = {
    0: {
        msg: '成功'
    },
    1: {
        msg: '服务器异常, 未知错误'
    },
    2: {
        msg: '无此功能'
    },
    3: {
        msg: '无权限操作'
    },
    4: {
        msg: '非法参数'
    },
    100: {
        msg: '数据重复，请检查'
    }
};

var SITE_USER_STATUS = {
    'NO_RUN': '未运行',
    'SCHEDULE': '计划中',
    'NEED_LOGIN': '需登录',
    'RUNNING': '运行中',
    'POSTING': '发贴中',
    'POST_SUCCESS': '已发贴',
    'SUCCESS': '已成功',
    'FAILURE': '失败了'
};

Ext.define('Fxt.view.SiteUserStatusCombox', {
    extend: 'Ext.form.ComboBox',
    alias: 'widget.site-user-status-combo',
    displayField: 'value',
    valueField: 'key',
    editable: false,
    store: {
        type: 'array',
        fields: ['key', 'value'],
        data: [
            ['', '全部'],
            ['NO_RUN', SITE_USER_STATUS['NO_RUN']],
            ['SCHEDULE', SITE_USER_STATUS['SCHEDULE']],
            ['NEED_LOGIN', SITE_USER_STATUS['NEED_LOGIN']],
            ['RUNNING', SITE_USER_STATUS['RUNNING']],
            ['POSTING', SITE_USER_STATUS['POSTING']],
            ['POST_SUCCESS', SITE_USER_STATUS['POST_SUCCESS']],
            ['SUCCESS', SITE_USER_STATUS['SUCCESS']],
            ['FAILURE', SITE_USER_STATUS['FAILURE']]
        ]
    }
});

Ext.define('Fxt.view.CityCombo', {
    extend: 'Fxt.view.BaseCombo',
    alias: 'widget.city-combo',
    $autoLoad: true,
    editable: false,
    $fields: [{
        name: 'key',
        mapping: 'id'
    }, {
        name: 'value',
        mapping: 'name'
    }],
    $url: Fxt.path + '/location/citys'
});

Ext.define('Fxt.view.StlMyAccountCombo', {
    extend: 'Fxt.view.BaseCombo',
    alias: 'widget.stl-my-account-combo',
    $autoLoad: true,
    editable: true,
    $fields: [{
        name: 'key',
        mapping: 'mobile'
    }, {
        name: 'value',
        mapping: 'label'
    }],
    $url: Fxt.path + '/lookup/stl-my-account'
});

Ext.define('Fxt.view.GtMyAccountCombo', {
    extend: 'Fxt.view.BaseCombo',
    alias: 'widget.gt-my-account-combo',
    $autoLoad: true,
    editable: true,
    $fields: [{
        name: 'key',
        mapping: 'mobile'
    }, {
        name: 'value',
        mapping: 'label'
    }],
    $url: Fxt.path + '/lookup/gt-my-account'
});